using System.Collections.Generic;
using UnityEngine;

namespace HEFramework
{
    /// <summary>
    /// Legacy data,Legacy.xlsx
    /// </summary>
    public class DRLegacy:IData
    {
        
        /// <summary>
        /// ID  different
        /// </summary>
        public int ID { get; protected set; }
        /// <summary>
        /// 名字  outputKey
        /// </summary>
        public string Name { get; protected set; }
        /// <summary>
        /// AB路径  
        /// </summary>
        public string ABPath { get; protected set; }
        /// <summary>
        /// AB昵称  
        /// </summary>
        public string ABName { get; protected set; }
        /// <summary>
        /// 质量类型  
        /// </summary>
        public int QualityType { get; protected set; }
        /// <summary>
        /// 是否发现  
        /// </summary>
        public int IsFind { get; protected set; }
        /// <summary>
        /// 是否占位  
        /// </summary>
        public int IsPlace { get; protected set; }
        /// <summary>
        /// 合成所需ID组  
        /// </summary>
        public int[] ComposeIDs { get; protected set; }
        /// <summary>
        /// 检索ID组  
        /// </summary>
        public int[] SearchIDs { get; protected set; }
        /// <summary>
        /// 元素ID组  
        /// </summary>
        public int[] ElementIDs { get; protected set; }
        /// <summary>
        /// 奖励ID组  
        /// </summary>
        public int[] RewardIDs { get; protected set; }
        /// <summary>
        /// 奖励值组  
        /// </summary>
        public int[] RewardValues { get; protected set; }

        
        public void ParseDataRow(string input)
        {
            string[] text = input.Split('	');
            int index = 0;
        
            ID = int.Parse(text[index++]);
            Name = DataTableExtension.GetStringFromKey(text[index++]);
            ABPath = text[index++];
            ABName = text[index++];
            QualityType = int.Parse(text[index++]);
            IsFind = int.Parse(text[index++]);
            IsPlace = int.Parse(text[index++]);
            ComposeIDs = DataTableExtension.ParseIntArr(text[index++]);
            SearchIDs = DataTableExtension.ParseIntArr(text[index++]);
            ElementIDs = DataTableExtension.ParseIntArr(text[index++]);
            RewardIDs = DataTableExtension.ParseIntArr(text[index++]);
            RewardValues = DataTableExtension.ParseIntArr(text[index++]);

        }
        
        private void AvoidJIT()
        {
            new Dictionary<int, DRLegacy>();
        }
    }
}